﻿using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;

namespace BoldBrick.OneIntranet.HR.FieldTypes
{
	public class InstalledLanguagesChoice : SPFieldText
	{
		#region ------ Constructors ---------------------------------------------------------------

		public InstalledLanguagesChoice(SPFieldCollection fields, string fieldName) : base(fields, fieldName)
		{
		}

		public InstalledLanguagesChoice(SPFieldCollection fields, string typeName, string displayName)
			: base(fields, typeName, displayName)
		{
		}

		#endregion

		public override BaseFieldControl FieldRenderingControl
		{
			get { return new InstalledLanguagesChoiceControl(); }
		}

		public override object GetFieldValue(string value)
		{
			uint lcid;
			if (uint.TryParse(value, out lcid))
				return lcid;

			return null;
		}
	}
}
